﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using VIBlend.WPF.Controls;

namespace AnonsaiWPF.CSharp.Buttons
{
    public partial class DropDownButtonDemo : Window, IWindow
    {
        public DropDownButtonDemo()
        {
            InitializeComponent();
            this.dropDownButton2.ButtonPositionChanged += new EventHandler(Button1_SecondaryButtonPositionChanged);
        }

        public void DetachContent()
        {
            RemoveLogicalChild(Content);
        }

        public void SetTheme()
        {
        }

        public Grid Root
        {
            get
            {
                return this.RootVisual;
            }
        }

        void Button1_SecondaryButtonPositionChanged(object sender, EventArgs e)
        {
            if (this.dropDownButton2 == null)
                return;

            if (this.dropDownButton2.ButtonPosition == ButtonPosition.Top || this.dropDownButton2.ButtonPosition == ButtonPosition.Bottom)
            {
                this.dropDownButton2.Height = 45;
            }
            else
            {
                this.dropDownButton2.Height = 25;
            }
        }

        private void radioButton2_Checked(object sender, RoutedEventArgs e)
        {
            if (this.dropDownButton2 == null)
                return;

             this.dropDownButton2.ButtonPosition = ButtonPosition.Left;
        }

        private void radioButton3_Checked(object sender, RoutedEventArgs e)
        {
            if (this.dropDownButton2 == null)
                return;

            this.dropDownButton2.ButtonPosition = ButtonPosition.Top;
        }

        private void radioButton4_Checked(object sender, RoutedEventArgs e)
        {
       
            if (this.dropDownButton2 == null)
                return;

            this.dropDownButton2.ButtonPosition = ButtonPosition.Bottom;
        }

        private void radioButton1_Checked(object sender, RoutedEventArgs e)
        {
       
            if (this.dropDownButton2 == null)
                return;

            this.dropDownButton2.ButtonPosition = ButtonPosition.Right;
        }

        private void RadioButton_Checked(object sender, RoutedEventArgs e)
        {
      
            if (this.dropDownButton2 == null)
                return;

            this.dropDownButton2.ToggleButtonContent = "High";
            this.dropDownButton2.IsDropDownOpen = false;
        }

        private void RadioButton_Checked_1(object sender, RoutedEventArgs e)
        {
       
            if (this.dropDownButton2 == null)
                return;

            this.dropDownButton2.ToggleButtonContent = "Average";
            this.dropDownButton2.IsDropDownOpen = false;
        }

        private void RadioButton_Checked_2(object sender, RoutedEventArgs e)
        {
        
            if (this.dropDownButton2 == null)
                return;

            this.dropDownButton2.ToggleButtonContent = "Low";
            this.dropDownButton2.IsDropDownOpen = false;
        }

        private void SpinEditor_ValueChanged(object sender, SpinEditorValueChangedEventArgs e)
        {
        
            if (this.dropDownButton2 == null)
                return;

             this.dropDownButton2.CornerRadius = new CornerRadius((double)e.Value);
        }
    }
}
